package com.kitchen.ui.dialog.shop
{
	import com.kitchen.ui.box9grid.BetweenBox;
	import com.kitchen.ui.box9grid.InnerBox;
	import com.kitchen.ui.box9grid.OuterBox;
	import com.kitchen.ui.dialog.AbstractDialog;
	import com.kitchen.ui.dialog.DialogHeader;
	import com.kitchen.ui.dialog.com.NextPageButton;
	import com.kitchen.ui.dialog.com.PrevPageButton;
	
	import flash.display.BitmapData;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;

	public class ShopDialog extends AbstractDialog
	{
		public function ShopDialog(main:BitmapData, dialog:BitmapData, shoper:Object=null, shop:Object=null)
		{
			super(main, dialog, shoper, shop);
		}
		
		override protected function layout(cdata:Object):void{
			this.w = 680;
			this.h = 580;
			this.blayout();
		}
		
		private function blayout():void{
			var outer:OuterBox = new OuterBox(this.dialogSkin, this.w, this.h-20);
			var between:BetweenBox = new BetweenBox(this.dialogSkin, 660, this.h-110);
			var inner1:InnerBox = new InnerBox(this.dialogSkin, 635, this.h-160);
			outer.x = 0;
			outer.y = 20;
			between.x = 10;
			between.y = 95;
			inner1.x = 20;
			inner1.y = 135;
			this.addChild(outer);
			this.addChild(between);
			this.addChild(inner1);
			var shopDecorate:ShopDecorateIcon = new ShopDecorateIcon(this.dialogSkin);
			shopDecorate.x = -10;
			shopDecorate.y = 5;
			this.addChild(shopDecorate);
			var head:ShopHead = new ShopHead(this.mainSkin);
			head.x = 250;
			head.y = 0;
			this.addChild(head);
			this.addCloseButton();
			
			var hot:HotButton = new HotButton(this.dialogSkin);
			hot.x = 32;
			hot.y = 110;
			this.addChild(hot);
			var news:NewButton = new NewButton(this.dialogSkin);
			news.x = 105;
			news.y = 110;
			this.addChild(news);
			/*
			var discount:DiscountButton = new DiscountButton(this.dialogSkin);
			discount.x = 181;
			discount.y = 110;
			this.addChild(discount);
			*/
			hot.setChecked(true);
			var next:NextPageButton = new NextPageButton(this.dialogSkin);
			next.x = 230;
			next.y = 520;
			this.addChild(next);
			var prev:PrevPageButton = new PrevPageButton(this.dialogSkin);
			prev.x = 100;
			prev.y = 520;
			this.addChild(prev);
			var rateTf:TextField = new TextField();
			rateTf.selectable = false;
			rateTf.width = 55;
			var tff:TextFormat = new TextFormat();
			tff.align = TextFormatAlign.CENTER;
			rateTf.defaultTextFormat = tff;
			rateTf.text = '1/20';
			rateTf.x =175;
			rateTf.y = 522;
			this.addChild(rateTf);
			
		}
		
		
		
	}
}